package com.aim.util;

import org.apache.commons.math3.stat.StatUtils;

/**
 * User: Avraham Shvartzon
 * Date: 1/29/15
 */
public class ArrayUtils {

    public static double sum(double[] arr){
        return StatUtils.sum(arr);
    }

    public static double[] smooth(double[] arr, double[] mask){
        int shift = mask.length/2;
        double[] smooth = new double[arr.length];
        for (int i = 0; i < arr.length; i++) {
            double value = 0;
            for (int j = 0; j < mask.length; j++) {
                int index = Math.max(0, i+j - shift);
                index = Math.min(index, arr.length-1);
              //  value +=
            }

        }
        return null;
    }
}
